﻿@model workflowMVC.Models.SimpleTaskModel 


<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>


<div style="margin:0 auto;width:600px;text-align:center" class="ui-widget ui-widget-content ui-corner-all">
@using (Html.BeginForm()){
<h2>@ViewBag.TaskName</h2>
    @Html.Label("Xin bạn nhập vào thông tin sau")
    <table style="margin:0 auto;">
        <tr>
            <td>
                @Html.LabelFor(m => m.Reason)
            </td>
            <td>
                @Html.TextAreaFor(m => m.Reason)
            </td>
        </tr>
        <tr>
            <td>
            </td>
            <td>
                @Html.ValidationMessageFor(m => m.Reason)
            </td>
        </tr>
        <tr>
            <td>
                @Html.LabelFor(m => m.Note)
            </td>
            <td>
                @Html.TextAreaFor(m => m.Note)
            </td>
        </tr>
        <tr>
            <td>
            </td>
            <td>
                @Html.ValidationMessageFor(m => m.Note)
            </td>
        </tr>
    
    </table>
<p>
    @ViewBag.Message
</p>
<div class="buttonset">
<input type="submit" value="Gửi"/>
<a href="#">Trở lại</a>
<a href="#" class="OpenWindow">Xem Mẫu Đơn</a>
</div>
}
</div>

<script type="text/javascript">
    $(document).ready(function () {
        $(".OpenWindow").live("click", function (event) {
        var form = $("form");
        $.ajax({
            url: "@ViewBag.FormSource",
            type: "PUT",
            data: form.serialize(),
            success: function (data) {
                callback(data);
            }
            });
        });
    });
</script>